// Data.java

package com.ruoyi.service.entity.user;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.service.domain.ServiceUsers;

import java.util.Date;
import java.util.List;

@lombok.Data
public class PCUserDetailRet {

    /** 状态  */
    private String code;
    private String status;

    /** 患者端用户表主键ID */
    private Long usersId;

    /** 姓名 */
    @Excel(name = "姓名/昵称")
    private String name;

    /** 头像地址 */
    @Excel(name = "头像地址")
    private String img;

    /** 手机号/账号 */
    @Excel(name = "手机号/账号")
    private String telephone;


    /** 最近访问时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "最近访问时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date currentTime;

    /** 注册创建时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "注册创建时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;

    /** 操作日志 */
    private List<PCUserLog> log;

    public void init(ServiceUsers user) {
        this.usersId = user.getUsersId();
        this.name = user.getUsersName();
        this.img = user.getNurseAvatar();
        this.telephone = user.getUsersTelephone();
        this.currentTime = user.getUsersCurrentlogintime();
        this.createTime = user.getUsersCreateTime();
        if ("0".equals(user.getUsersUseFlag())){
            this.status = "正常";
            this.code = "normal";
        }else{
            this.status = "锁定";
            this.code = "locked";
        }
    }

    /** 更新者 */
    //@Excel(name = "更新者")
    //private String usersUpdateBy;

    /** 更新时间 */
    //@JsonFormat(pattern = "yyyy-MM-dd")
    //@Excel(name = "更新时间", width = 30, dateFormat = "yyyy-MM-dd")
    //private Date usersUpdateTime;

    /** 启用标志（0代表启用 2代表不启用） */
    //@Excel(name = "启用标志", readConverterExp = "0=代表启用,2=代表不启用")
    //private String usersUseFlag;

    /** 删除标志（0代表存在 2代表删除） */
    //@Excel(name = "删除标志", readConverterExp = "0=代表存在,2=代表删除")
    //private String usersDelFlag;

    /** 备注 */
    //@Excel(name = "备注")
    //private String usersRemark;

    /** 操作日志表ID */
    //@Excel(name = "操作日志表ID")
    //private Long usersLogid;

    /** 锁定原因表ID */
    //@Excel(name = "锁定原因表ID")
    //private Long usersReasonid;

    /** 锁定补充说明 */
    //@Excel(name = "锁定补充说明")
    //private String usersExplanation;


}